//
//  YUXiuConfigs.h
//  YUXiu
//
//  Created by 王竞成 on 16/6/22.
//  Copyright © 2016年 Wang. All rights reserved.
//

#ifndef YUXiuConfigs_h
#define YUXiuConfigs_h

//
//  GolbalConfigs.h
//  Golf
//
//  Created by 刘俊 on 16/4/8.
//  Copyright © 2016年 刘俊. All rights reserved.
//

#ifndef GolbalConfigs_h
#define GolbalConfigs_h

#define CORNERRADIUS_BTN 5  /**< 按钮圆环半径 */

#pragma mark- UINavigationBar
//导航栏高度
#define kNavigationBarHeight 44

#pragma mark- UIStatusBar
//状态栏高度
#define kStatusBarHeight      20
//银联支付的model，00为正式环境 01为测试环境
#define kTestmode @"01"
#define kAppStoreMode @"00"



#pragma mark- UIDevice
//系统版本
#define kSystemVersion                  [[[UIDevice currentDevice]systemVersion] floatValue]
#define kAppName                        [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleNameKey]
#define kAppVersion                     [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleVersionKey]
#define kAppBundleIdentifier            [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleIdentifierKey]

#define IsweixinAPP [WXApi isWXAppInstalled]
#define IsqqApp [QQApiInterface isQQInstalled]

#pragma mark- UIScreen
//屏幕宽
#define kScreenWidth                    [UIScreen mainScreen].bounds.size.width
#define kScreenHeight                   [UIScreen mainScreen].bounds.size.height
#define kKeyWindow                      [UIApplication sharedApplication].keyWindow

//手机屏幕
#define IPHONE_4S_SCREEN_HEIGHT          480
#define IPHONE_5_5S_SCREEN_HEIGHT        568
#define IPHONE_6_SCREEN_HEIGHT           667
#define IPHONE_6P_SCREEN_HEIGHT          736

#define AutoSizeScaleX                  ((kScreenHeight > 480)?(kScreenWidth/320):1.0)
#define AutoSizeScaleY                  ((kScreenHeight > 480)?(kScreenHeight/568):1.0)

#define CGRectMake1(x,y,width,height)   CGRectMake((x)*AutoSizeScaleX, (y)*AutoSizeScaleY, (width)*AutoSizeScaleX, (height)*AutoSizeScaleY)
#define CGPointMake1(x,y)               CGPointMake((x)*AutoSizeScaleX, (y)*AutoSizeScaleY)


#pragma mark- UIColor
#define ViewBGColor kColorRGB(244, 244, 244)
#define kColorRGB(R,G,B)                [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:1]
#define PricColor                        kColorRGB(255, 104, 22)
#define kRGB(R,G,B)                [UIColor colorWithRed:R green:G blue:B alpha:1]

#define kCreatImage(X)   [UIImage imageNamed:X]

#define UIColorFromRGB(rgbValue)        [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define kColorHexString(hexStr)         [UIColor colorWithHexString:hexStr]
//#ff6816
#define PricColor kColorRGB(255, 104, 22)
//#878787
#define LabeColor kColorRGB(135, 135, 135)
//#262626
#define LabeColor26 kColorRGB(38, 38, 38)
//#2D2D2D
#define LabeColor2D kColorRGB(45, 45, 45)
//#4D4D4D
#define LabeColor4D kColorRGB(77, 77, 77)
//#6D6D6D
#define LabeColor6D kColorRGB(109, 109, 109)


//过期提醒
#define LIU_DEPRECATED(fmt)  NS_DEPRECATED(2_0,2_0,2_0,2_0,fmt)

/*
 *__FILE__              当前调试所在的源文件名 [文件名:%s]    __FILE__
 *__FUNCTION__          当前调试所在的函数名称 [函数名:%s]    __FUNCTION__
 *__PRETTY_FUNCTION__   当前调试所在的函数名称 [函数名:%s]    __PRETTY_FUNCTION__
 *__LINE__              当前调试所在的行号     [行号:%d]     __LINE__
 *__VA_ARGS__           当前调试可携带的参数     fmt         __VA_ARGS__
 */
#ifdef DEBUG
#define DBLog(fmt,...) NSLog((@"\n函数名:%s\n行号:%d\n'fmt'\n\n"),__PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define DBLog(...)
#endif

#ifdef DEBUG
#   define ULog(fmt, ...)  { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [Line %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__]  delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; }
#else
#   define ULog(...)
#endif

#pragma mark- GCD
#define kGlobalQueue(block)         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block)
#define kMainQueue(block)           dispatch_async(dispatch_get_main_queue(),block)

#pragma mark- WeakSelf
#define WS(weakSelf) __weak __typeof(&*self)weakSelf=self

#pragma mark- 判断textField是否为空
#define kStringIsNill(fmt) ([fmt isEqual:[NSNull null]] || [fmt isEqualToString:@""] || fmt == nil)

#define kString(x)    [NSString stringWithFormat:@"%@", x == nil ? @"" : x];
#define kStringInt(x) [NSString stringWithFormat:@"%d", x];
#define FontC(x)  [UIFont fontWithName:@"AppleGothic" size:x]
//----------------：字体相关------------------------

#define Font(x)   [UIFont systemFontOfSize:x]        //设置系统字体
#define FontB(x)  [UIFont boldSystemFontOfSize:x]    //设置系统字体

//----------------：控件相关------------------------

#define krect(x, y, w, h) CGRectMake(x, y, w, h)

#define String(x)    [NSString stringWithFormat:@"%@", x == nil ? @"" : x];

#define HexRGB(rgbValue)                                                                           \
[UIColor colorWithRed:((float) ((rgbValue & 0xFF0000) >> 16)) / 255.0                          \
green:((float) ((rgbValue & 0xFF00) >> 8)) / 255.0                             \
blue:((float) (rgbValue & 0xFF)) / 255.0                                      \
alpha:1.0]

//Block 获取界面的点击事件
typedef void (^DidTapActionBlock)();

#endif /* GolbalConfigs_h */


#endif /* YUXiuConfigs_h */
